<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/10/20
 * Time: 13:39
 */
?>
<div class="page-top">
    <nav class="navbar navbar-default" role="navigation">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                        data-target="#bs-example-navbar-collapse-1">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="<?=\i::a('index','index')?>">iphp</a>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">

                <ul class="nav navbar-nav">
                    <?php
                    $navary=[
                        [
                            'href'=>\i::a('index','index',[]),
                            'text'=>'首页',
                        ],
                        [
                            'href'=>\i::a('index','page_quickstart',[]),
                            'text'=>'快速开始',
                        ],
                        [
                            'href'=>\i::a('index','page_doc',[]),
                            'text'=>'文档',
                        ],
                        [
                            'href'=>\i::a('index','page_about',[]),
                            'text'=>'关于项目',
                        ],
                    ];
                    isset($active_nav) or $active_nav=0;
                    foreach ($navary as $k=>$v)
                    {
                        $active_str='';
                        $active_nav==$k and $active_str=" active ";
                        ?>
                        <li  class=" <?=$active_str?> "><a href="<?=$v['href']?>"><?=$v['text']?></a></li>
                        <?php
                    }
                    ?>


                </ul>
            </div><!-- /.navbar-collapse -->
        </div><!-- /.container-fluid -->
    </nav>
</div>
